package cn.itrip.auth.service;

import cn.itrip.beans.domain.ItripUser;
import cn.itrip.beans.vo.TokenVo;
import cn.itrip.common.DtoUtils;
import cn.itrip.common.TokenUtil;
import com.itrip.dao.ItripUserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@Service(value = "loginService")
public class LoginService {
    @Resource
    private TokenUtil tokenUtil;
    @Resource
    private ItripUserMapper itripUserMapper;

    public ItripUser Login(String name, String password){
        return itripUserMapper.getlogin(name,password);
    }

    public TokenVo createToken(ItripUser user,String userAgent){
        return tokenUtil.createToken(user,userAgent);
    }

}
